package com.xiaobias.a43;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;

public class Bean1 implements BeanFactoryAware {

     private static final Logger logger = LoggerFactory.getLogger(Bean1.class);

     private Bean2 bean2;

    public Bean2 getBean2() {
        return bean2;
    }

    @Autowired
    public void setBean2(Bean2 bean2) {
        logger.debug("setBean2({})", bean2);
        this.bean2 = bean2;
    }

    @PostConstruct
    public void init() {
        logger.debug("init()");
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        logger.debug("setBeanFactory({})", beanFactory);
    }
}
